function LeftItem(
  title = '暂无标题',
  like = 0,
  post_url = '#'
) {
  const htmlString = `
    <a href="${post_url}" class="list-group-item list-group-item-action">
      <h6 class="mb-1">
        ${title}
        <span class="badge bg-danger float-end">
          ♥ ${like}
        </span>
      </h6>
    </a>
  `;

  return htmlString;
}

function LeftItem1(
  title = '暂无标题',
  timeago = '0秒前',
  post_url = '#'
) {
  const htmlString = `
    <a href="${post_url}" class="list-group-item list-group-item-action">
      <h6 class="mb-1">
        ${title}
        <span class="badge bg-secondary float-end">
          ${timeago}
        </span>
      </h6>
    </a>

  `;

  return htmlString;
}

function LeftItem2(
  timeago = '0秒前',
  username = '匿名用户',
  user_icon = 'https://via.placeholder.com/50',
  user_url = '#'
) {
  const htmlString = `
    <a href="${user_url}" class="list-group-item list-group-item-action">
      <div class="d-flex justify-content-between">
        <div class="d-flex align-items-center">
          <img src="${user_icon}" alt="${username}'s icon" class="rounded-circle me-2" width="40" height="40">
          <span class="fw-bold">${username}</span>
        </div>
        <span class="badge bg-secondary">${timeago}</span>
      </div>
    </a>
  `;

  return htmlString;
}


function RightItem(
  post_url = '#',
  icon_url = '#',
  user_url = '#',
  title = '暂无标题',
  username = '匿名用户',
  datetime = '2025-04-20',
  like = 0,
  sort = '暂无类别'
) {
  const htmlString = `
    <div class="card mb-4" style="cursor: pointer;" onclick="window.location.href='${post_url}'">
      <div class="card-body">
        <h5 class="card-title">${title}</h5>
      </div>
      <hr class="my-2">
      <div class="d-flex align-items-center px-3 pb-3">
        <img src="${icon_url}" alt="用户头像" class="rounded-circle me-2" style="width: 30px; height: 30px; object-fit: cover;">
        <a href="${user_url}" class="me-3 text-decoration-none">${username}</a>
        <span class="me-3 text-muted">
          <i class="bi bi-calendar-event"></i> ${datetime}
        </span>
        <span class="text-danger">
          <i class="bi bi-heart-fill"></i> ${like}
        </span>
        <span class="badge bg-primary text-light ms-2">${sort}</span>
      </div>
    </div>
  `;
  return htmlString;
}
